/*
 * Copyright 2011 Digia Oyj - Jaakko Purhonen <jaakko.purhonen@digia.com>
 */

#ifndef TRACSETTINGS_H
#define TRACSETTINGS_H

#include <QtCore/QString>


namespace Constants {

    const char * const RPC_GETPROJECTCATEGORIES = "projects.getProjectCategories";
    const char * const RPC_SEARCHPROJECTS = "projects.searchProjects";
    const char * const RPC_OPENPROJECT = "projects.openProject";
    const char * const RPC_CREATEPROJECT = "projects.createProject";

    const char * const STRING_GIT = "Git";
    const char * const STRING_MERCURIAL = "Mercurial";
    const char * const STRING_SUBVERSION = "Subversion";

    const char * const ERRORSTRING_PROJECTNAMEEXISTS = "Project with the current name exists! Choose another name.";
    const char * const ERRORSTRING_PROJECTNAMETOOSHORT = "Too short project name! It should be at least two character.";
    const char * const ERRORSTRING_PROJECTIDENTIFIEREXISTS = "Project with the current identifier exists! Choose another identifier.";
    const char * const ERRORSTRING_PROJECTIDENTIFIERTOOLONG = "Too long project indentifier! Length can be 32 characters at most.";
    const char * const ERRORSTRING_PROJECTDESCRIPTION = "Too short project description! It should be at least eight characters.";

    const char * const BINARY_GIT = "git";
    const char * const BINARY_MERCURIAL = "hg";
    const char * const BINARY_SUBVERSION = "svn";

    const char * const CLONECOMMAND_GIT_MERCURIAL = "clone";
    const char * const CLONECOMMAND_SUBVERSION = "co";
}

class TracSettings
{


public:

    static TracSettings *instance();
    ~TracSettings();
    QString username() const;
    void setUsername(const QString &username);
    QString password() const;
    void setPassword(const QString &password);
    QString hostName() const;
    void setHostName(const QString &hostName);
    QString binary() const;
    void setBinary(const QString &binary);
    QString vcsSystem() const;
    void setVcsSystem(const QString &vcsSystem);
    QString cloneCommand() const;
    void setCloneCommand(const QString &cloneCommand);
    QString cloneUrl() const;
    void setCloneUrl(const QString &cloneUrl);
    QString visibleCloneUrl() const;
    void setVisibleCloneUrl(const QString &visibleCloneUrl);
    QString workingPath() const;
    void setWorkingPath(const QString &workingPath);
    QString checkoutDirectory() const;
    void setCheckoutDirectory(const QString &checkoutDirectory);

    QString projectFile() const;
    void setProjectFile(const QString &projectFile);
    QString projectName() const;
    void setProjectName(const QString &projectName);
    QString projectIdentifier() const;
    void setProjectIdentifier(const QString &projectIdentifier);
    QString projectDescription() const;
    void setProjectDescription(const QString &projectDescription);
    QString versionControlSystem() const;
    void setVersionControlSystem(const QString &versionControlSystem);
    bool isPublicProject() const;
    void setIsPublicProject(const bool isPublicProject);

protected:

private:
    TracSettings();
    static TracSettings *m_instance;
    QString m_username;
    QString m_password;
    QString m_hostName;
    QString m_binary;
    QString m_vcsSystem;
    QString m_cloneCommand;
    QString m_cloneUrl;
    QString m_visibleCloneUrl;
    QString m_workingPath;
    QString m_checkoutDirectory;

    QString m_projectFile;
    QString m_projectName;
    QString m_projectIdentifier;
    QString m_projectDescription;
    QString m_versionControlSystem;
    bool m_isPublicProject;
};

#endif // TRACSETTINGS_H
